Exponentially Weighted Moving Averaging (“EWMA”) filtering is a data processing technique used to reduce the variability of an incoming stream of data that is monitored over a period of time. A EWMA filter calculates an averaged or filtered value that is based on raw data points collected from the incoming stream of data. In one approach, EWMA filtering may be used to filter data collected by a nitrogen oxide sensor (“NOx”) sensor. The NOx sensor may be located within an exhaust gas conduit of an exhaust gas treatment system, and is used to generate a signal that is indicative of the level of NOx in exhaust gas emitted from an internal combustion engine. The EWMA filter monitors the data collected by the NOx sensor to determine a filtered value.
In the event the filtered value determined by the EWMA filter exceeds a maximum threshold value or is below a minimum threshold value during a diagnostic test, a diagnostic trouble code (“DTC”) may be set to a fail status. The fail status indicates that there may be an issue with the NOx sensor (e.g., an element in the sensor is cracked, or contaminated), and a malfunction indicator light (“MIL”) may be illuminated to indicate the fault. Corrective action may be taken to repair or replace the NOx sensor. However, if the fail status stored in the vehicle computer is not manually cleared after the corrective action, the MIL light will eventually be turned off or deactivated after the filtered value determined by the EWMA filter is below the fault threshold value, and the diagnostic test is passed a predetermined number of times. Specifically, some types of regulations require that the diagnostic test passes for three key or ignition cycles before the MIL is allowed to deactivate at the beginning of the fourth key cycle.
EWMA filtering may delay deactivating the MIL. This is because EWMA filtering tends to place significant emphasis on relatively older data collected from the NOx sensor that indicates the fail status. Thus, the filtered value calculated by the EWMA filter may exceed the threshold value even after the NOx sensor has been repaired or replaced. Accordingly, it is desirable to provide an approach for EWMA filtering that provides a filtered value with increased accuracy.